#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int main()
{
	int n, a, b, c, d;
	scanf("%d", &n);
	a = n / 1000;
	b = (n / 100) % 10;
	c = (n % 100) / 10;
	d = n % 10;
	a = (a + 9) % 10;
	b = (b + 9) % 10;
	c = (c + 9) % 10;
	d = (d + 9) % 10;
	printf("The encrypted number is %d%d%d%d\n", c, d, a, b);

	return 0;
}
//1065 重复题(1270)解法2
//掌握计算多位数的各个位数的方法，如：3，4位数